import { MockMethod } from 'vite-plugin-mock'
import { resultSuccess, resultError, API_PREFIX } from '../_util'
import pub from './pub'
import systemRole from './system/role'
import userManage from './system/user'
import logsManage from './system/log'
import authorityManage from './system/authority'
import channelManage from './system/channel'
import tenantManage from './tenant/manage'
import tenantManageUser from './tenant/manageUser'
import deployUpgrade from './deployUpgrade/index'
import productManage from './goods/product'
import packageManage from './goods/package'
import statistics from './statistics/index'
import companyManage from './tenant/company'
import { ResultEnum } from '../enums/httpEnum'

export default [
  // 登录
  {
    url: `${API_PREFIX}/tenant/manage/signin/login`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess(pub.userInfo)
    }
  },
  // 获取当前登录用户信息
  {
    url: `${API_PREFIX}/tenant/manage/signin/getCurrentLoginUser`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess(pub.currentUserInfo)
    }
  },
  // 更换当前登录信息邮箱
  {
    url: `${API_PREFIX}/tenant/manager/user/updateEmail`,
    method: 'post',
    response: () => {
      return resultSuccess()
    }
  },
  // 更换当前登录信息手机号
  {
    url: `${API_PREFIX}/tenant/manager/user/updatePhone`,
    method: 'post',
    response: () => {
      return resultSuccess()
    }
  },
  // 登出
  {
    url: `${API_PREFIX}/tenant/manage/signin/logout`,
    method: 'post',
    response: () => {
      return resultSuccess()
    }
  },
  // 获取手机验证码
  {
    url: `${API_PREFIX}/tenant/website/getSmsCode`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess()
    }
  },
  // 注册租户
  {
    url: `${API_PREFIX}/tenant/website/reg`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess()
    }
  },
  // 获取数据字典项列表
  {
    url: `${API_PREFIX}/tenant/manage/basic/dict/getDictItem`,
    method: 'post',
    response: (req: any) => {
      const typeCode = req.body.typeCode
      return pub.getDictItem(typeCode)
    }
  },
  // 所属行业列表
  {
    url: `${API_PREFIX}/tenant/manager/industry/platformIndustry`,
    method: 'post',
    response: () => {
      return resultSuccess(pub.platformIndustry)
    }
  },
  // 渠道列表
  {
    url: `${API_PREFIX}/tenant/manager/homePage/queryChannelList`,
    method: 'post',
    response: () => {
      return resultSuccess(pub.queryChannelList)
    }
  },
  // 用户菜单权限列表
  {
    url: `${API_PREFIX}/tenant/manage/authority/getAuthorityTreeByUserId`,
    method: 'post',
    response: () => {
      return pub.menuInfo
    }
  },
  // 用户功能权限列表
  {
    url: `${API_PREFIX}/tenant/manage/authority/getButtonAuthorityByUserId`,
    method: 'post',
    response: () => {
      return pub.sysAccountActionListInquiry
    }
  },
  // 操作日志列表
  {
    url: `${API_PREFIX}/tenant/manage/logs/list`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess(logsManage.logsList)
    }
  },
  // 渠道管理列表
  {
    url: `${API_PREFIX}/tenant/manage/channel/page/list`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess(channelManage.channelList)
    }
  },
  // 查询渠道套餐配置信息
  {
    url: `${API_PREFIX}/tenant/manage/channel/getPackageConfig`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess(channelManage.getPackageConfig)
    }
  },
  // 保存或更新渠道套餐配置信息
  {
    url: `${API_PREFIX}/tenant/manage/channel/saveOrUpdate`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess()
    }
  },

  // 角色列表
  {
    url: `${API_PREFIX}/tenant/manage/role/list`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess(systemRole.roleList)
    }
  },
  // 角色权限列表
  {
    url: `${API_PREFIX}/tenant/manage/authority/all`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess(systemRole.roleAuthList)
    }
  },
  // 角色新增
  {
    url: `${API_PREFIX}/tenant/manage/role/add`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess()
    }
  },
  // 角色修改
  {
    url: `${API_PREFIX}/tenant/manage/role/update`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess()
    }
  },
  // 角色详情
  {
    url: `${API_PREFIX}/tenant/manage/role/get`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess(systemRole.roleDetail)
    }
  },
  // 角色删除
  {
    url: `${API_PREFIX}/tenant/manage/role/delete`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess()
    }
  },
  // 用户列表
  {
    url: `${API_PREFIX}/tenant/manager/user/list`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess(userManage.userList)
    }
  },
  // 根据角色查询用户列表
  {
    url: `${API_PREFIX}/tenant/manager/user/listByRoleId`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess(userManage.userList)
    }
  },
  // 用户新增
  {
    url: `${API_PREFIX}/tenant/manager/user/create`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess()
    }
  },
  // 用户修改
  {
    url: `${API_PREFIX}/tenant/manager/user/update`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess()
    }
  },
  // 用户详情
  {
    url: `${API_PREFIX}/tenant/manager/user/getById`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess(userManage.userDetail)
    }
  },
  // 用户删除
  {
    url: `${API_PREFIX}/tenant/manager/user/delete`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess()
    }
  },
  // 用户重置密码
  {
    url: `${API_PREFIX}/tenant/manager/user/resetPwd`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess()
    }
  },
  // 用户修改密码
  {
    url: `${API_PREFIX}/tenant/manager/user/updatePwd`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess()
    }
  },
  // 租户列表
  {
    url: `${API_PREFIX}/tenant/manager/enterprise/list`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess(tenantManage.enterpriseList)
    }
  },
  // 企业管理分页查询
  {
    url: `${API_PREFIX}/tenant/manager/enterprise/page`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess(companyManage)
    }
  },
  // 企业停用/启用
  {
    url: `${API_PREFIX}/tenant/manager/enterprise/switchEnterprise`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess()
    }
  },
  // 企业导出
  {
    url: `${API_PREFIX}/tenant/manager/enterprise/export`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess()
    }
  },
  // 租户新增
  {
    url: `${API_PREFIX}/tenant/manager/enterprise/create`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess()
    }
  },
  // 租户修改
  {
    url: `${API_PREFIX}/tenant/manager/enterprise/update`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess()
    }
  },
  // 租户删除
  {
    url: `${API_PREFIX}/tenant/manager/enterprise/del`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess()
    }
  },
  // 租户详情
  {
    url: `${API_PREFIX}/tenant/manager/enterprise/get`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess(tenantManage.enterpriseDetail)
    }
  },
  // 租户跳转登录
  {
    url: `${API_PREFIX}/tenant/manager/enterprise/adminLogin`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess({
        token:
          'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBJZCI6IjEiLCJsb2dpblVzZXJJZCI6IjEwMDAzMSIsImxvZ2luVXNlckFjY291bnQiOiIxODg0NDc5NzYxNiIsImxvZ2luVGVuYW50SWQiOiJCUDFlZWRjOTU0MTEwODQyMTQ4MDJkOGJlOTIwYzliMTE4IiwibG9naW5Ub3BUZW5hbnRJZCI6IkJQMWVlZGM5NTQxMTA4NDIxNDgwMmQ4YmU5MjBjOWIxMTgiLCJsb2dpblVzZXJUeXBlIjoiMSIsImV4cCI6MTcwMjQ2ODA0MH0.Lsbw0Ro44sIqHpuvElLf4JNf7F99DWqno7E1xseQcSQ'
      })
    }
  },
  // 获取租户所有的机构列表
  {
    url: `${API_PREFIX}/tenant/manager/enterprise/allList`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess(tenantManageUser.enterpriseAllList)
    }
  },
  // 获取租户用户列表查询
  {
    url: `${API_PREFIX}/tenant/manager/enterprise/user/list`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess(tenantManageUser.enterpriseUserList)
    }
  },
  // 用户状态启用禁用
  {
    url: `${API_PREFIX}/tenant/manager/enterprise/user/updateStatusById`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess()
    }
  },
  // 企业用户删除用户
  {
    url: `${API_PREFIX}/tenant/manager/enterprise/user/delete`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess()
    }
  },
  // 获取租户顶级机构的所有机构列表
  {
    url: `${API_PREFIX}/tenant/manager/enterprise/allListByTenantId`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess(tenantManageUser.enterpriseList)
    }
  },
  // 创建企业用户
  {
    url: `${API_PREFIX}/tenant/manager/enterprise/user/add`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess()
    }
  },
  // 用户授权
  {
    url: `${API_PREFIX}/tenant/manager/enterprise/user/auth`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess()
    }
  },
  // 查询应用授权列表
  {
    url: `${API_PREFIX}/tenant/manage/application/appAuthList`,
    method: 'post',
    response: () => {
      return resultSuccess(tenantManage.appAuthList)
    }
  },
  // 税局账号验证
  {
    url: `${API_PREFIX}/tenant/website/accountCheck`,
    method: 'post',
    timeout: 2000,
    response: () => {
      return resultSuccess({
        orgName: '测试企业',
        phone: '15846985478'
      })
    }
  },
  // 注册第一步提交
  {
    url: `${API_PREFIX}/tenant/website/oneSubmit`,
    method: 'post',
    timeout: 2000,
    response: () => {
      return resultSuccess()
    }
  },
  // 租户授权
  {
    url: `${API_PREFIX}/tenant/manager/enterprise/auth`,
    method: 'post',
    timeout: 6000,
    response: () => {
      return resultSuccess()
    }
  },
  // 重置超管密码
  {
    url: `${API_PREFIX}/tenant/manager/enterprise/resetAdminPwd`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess()
    }
  },
  // 查询镜像仓库列表
  {
    url: `${API_PREFIX}/deploy/manager/swr/listReposDetails`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess(deployUpgrade.listReposDetails)
    }
  },
  // 查询树形菜单权限
  {
    url: `${API_PREFIX}/tenant/manage/authority/getAuthorityTreeByUserId`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess(authorityManage.getAuthorityTreeByUserId)
    }
  },
  // 添加权限信息
  {
    url: `${API_PREFIX}/tenant/manage/authority/add`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess()
    }
  },
  // 修改权限信息
  {
    url: `${API_PREFIX}/tenant/manage/authority/update`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess()
    }
  },
  // 删除权限信息
  {
    url: `${API_PREFIX}/tenant/manage/authority/delete`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess()
    }
  },
  // 查询镜像列表
  {
    url: `${API_PREFIX}/deploy/manager/swr/listRepositoryTags`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess(deployUpgrade.listRepositoryTags)
    }
  },
  // 查询镜像组织
  {
    url: `${API_PREFIX}/deploy/manager/swr/listNamespaces`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess(deployUpgrade.listNamespaces)
    }
  },
  // 查询容器命名空间
  {
    url: `${API_PREFIX}/deploy/manager/cce/listNamespaced`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess(deployUpgrade.listNamespaced)
    }
  },
  // 查询命名空间YAML
  {
    url: `${API_PREFIX}/deploy/manager/cce/namespacedYaml`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess(deployUpgrade.namespacedYaml)
    }
  },
  // 查工作负载
  {
    url: `${API_PREFIX}/deploy/manager/cce/deploymentList`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess(deployUpgrade.deploymentList)
    }
  },
  // 查询工作负载YAML
  {
    url: `${API_PREFIX}/deploy/manager/cce/deploymentYaml`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess(deployUpgrade.namespacedYaml)
    }
  },
  // 查工作负载应用详情
  {
    url: `${API_PREFIX}/deploy/manager/cce/podList`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess(deployUpgrade.podList)
    }
  },
  // 查询部署任务列表
  {
    url: `${API_PREFIX}/deploy/manager/task/findTaskList`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess(deployUpgrade.findTaskList)
    }
  },
  // 创建部署任务
  {
    url: `${API_PREFIX}/deploy/manager/cce/deployTask`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess()
    }
  },
  // 查询部署包列表
  {
    url: `${API_PREFIX}/deploy/manager/task/packageList`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess(deployUpgrade.packageList)
    }
  },
  // 查询部署项目列表
  {
    url: `${API_PREFIX}/deploy/manager/task/systemNameList`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess(deployUpgrade.systemNameList)
    }
  },
  // 查询应用列表
  {
    url: `${API_PREFIX}/deploy/manager/app/findAppList`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess(deployUpgrade.findAppList)
    }
  },
  // 新增应用
  {
    url: `${API_PREFIX}/deploy/manager/app/addApp`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess()
    }
  },
  // 编辑应用
  {
    url: `${API_PREFIX}/deploy/manager/app/editApp`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess()
    }
  },
  // 查询部署项目列表
  {
    url: `${API_PREFIX}/deploy/manager/project/findProjectList`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess(deployUpgrade.findProjectList)
    }
  },
  // 新增部署项目
  {
    url: `${API_PREFIX}/deploy/manager/project/addProject`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess()
    }
  },
  // 删除部署项目
  {
    url: `${API_PREFIX}/deploy/manager/project/delProject`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess()
    }
  },
  // 修改部署项目
  {
    url: `${API_PREFIX}/deploy/manager/project/editProject`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess()
    }
  },
  // 获取商品列表
  {
    url: `${API_PREFIX}/tenant/manager/goods/queryPage`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess(productManage.goodsList)
    }
  },
  // 删除商品
  {
    url: `${API_PREFIX}/tenant/manager/goods/delById`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess()
    }
  },
  // 商品权限列表
  {
    url: `${API_PREFIX}/tenant/manager/goods/addGoods/allAppAuthority`,
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess(productManage.goodsAuthList)
    }
  },
  // 商品新增
  {
    url: `${API_PREFIX}/tenant/manager/goods/add`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess()
    }
  },
  // 商品修改
  {
    url: `${API_PREFIX}/tenant/manager/goods/modifyById`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess()
    }
  },
  // 所有商品列表
  {
    url: `${API_PREFIX}/tenant/manager/package/addPackage/allGoods`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess(productManage.packageAllList)
    }
  },
  // 获取套餐列表
  {
    url: `${API_PREFIX}/tenant/manager/package/queryPage`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess(packageManage.packageList)
    }
  },
  // 删除套餐
  {
    url: `${API_PREFIX}/tenant/manager/package/delById`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess()
    }
  },
  // 套餐上架下架
  {
    url: `${API_PREFIX}/tenant/manager/package/modifyStatusById`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess()
    }
  },
  // 套餐新增
  {
    url: `${API_PREFIX}/tenant/manager/package/add`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess()
    }
  },
  // 套餐编辑
  {
    url: `${API_PREFIX}/tenant/manager/package/modifyById`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess()
    }
  },
  // 分页查询企业开票任务统计
  {
    url: `${API_PREFIX}/tenant/manager/statistic/analysis/queryPage`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess(statistics.statisticsList)
    }
  },
  // 查询企业开票任务总统计
  {
    url: `${API_PREFIX}/tenant/manager/statistic/analysis/queryTotal`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess(statistics.statisticsTotal)
    }
  },
  {
    url: `${API_PREFIX}/biaopu-tms-pub-provider/pub/login/genCheckSmSCode`,
    method: 'post',
    timeout: 3000,
    response: () => {
      return resultSuccess()
    }
  },
  {
    url: `${API_PREFIX}/test/get/data`,
    method: 'post',
    timeout: 2000,
    response: () => {
      return pub.tableList
    }
  },
  {
    url: `${API_PREFIX}/tenant/manager/order/updateStatus/invalid`,
    method: 'post',
    timeout: 1000,
    response: () => {
      return resultSuccess()
    }
  }
] as MockMethod[]
